package com.fagejiang.memory;

import java.util.concurrent.ConcurrentHashMap;

/**
 * 你还没有写描述儿~
 *
 * @author <发哥讲Java-694204477@qq.com>
 * @version 1.0
 * @date 2021-06-16 20:29
 */
public class DataPool {
    public volatile static ConcurrentHashMap<String, String> XQ_MAP = new ConcurrentHashMap<>();
    public volatile static ConcurrentHashMap<String, String> SQ_MAP = new ConcurrentHashMap<>();
    public volatile static ConcurrentHashMap<String, String> CUN_MAP = new ConcurrentHashMap<>();


    public static void addXq(String k, String v) {
        XQ_MAP.put(k, v);
    }

    public static void addSq(String k, String v) {
        SQ_MAP.put(k, v);
    }

    public static void addCun(String k, String v) {
        CUN_MAP.put(k, v);
    }


    /**
     * todo 待处理
     *
     * @param xqid
     * @return
     */
    public static String getXqNameByXqId(String xqid) {
        return xqid != null && XQ_MAP.containsKey(xqid) ? XQ_MAP.get(xqid) : null;
    }

    public static String getCunJWHNameByDm(String dm) {
        return dm != null && CUN_MAP.containsKey(dm) ? CUN_MAP.get(dm) : null;
    }

    public static String getSheQuNameByDm(String dm) {
        return dm != null && SQ_MAP.containsKey(dm) ? SQ_MAP.get(dm) : null;
    }
}
